﻿<?xml version="1.0" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
	namespace="DataAccess" assembly="DataAccess">

  <class name="DataAccess.EducationModule, DataAccess" table="EDUCATION_MODULE">
    <id name="Id" column="ID" type="Int64">
		<generator class="identity"/>
    </id>
    <property name="Name" type="String" column="NAME"/>
    <property name="Description" type="String" column="DESCRIPTION"/>
	<property name="ParticipantType" type="String" column="PARTICIPANT_TYPE"/>
    <property name="HoldingType" type="String" column="HOLDING_TYPE"/>
	<property name="IsNeedApprove" type="Boolean" column="NEED_APPROVE"/>
	<property name="IsPublicAssigne" type="Boolean" column="PUBLIC_ASSIGNE"/>
	<property name="Pay" type="Int32" column="PAY"/>
	<property name="PayCurrancy" type="String" column="PAY_CURRENCY"/>
	<property name="Duration" type="Int32" column="DURATION"/>
	<property name="DurationType" type="String" column="DURATON_TYPE"/>
	<property name="Labels" type="String" column="LABELS"/>
	<property name="Difficult" type="String" column="DIFFICULT"/>
	<property name="Status" type="String" column="STATUS"/>
    <list name="Users" table="USER2EDUCATION">
		<key column="MODULE_ID" />
		<index column="ID" />
		<many-to-many
			column="USER_ID"
			class="DataAccess.User, DataAccess"
			outer-join="true" />
    </list>
	<list name="DependModules" table="MODULE_DEPENDENCE">
		<key column="DEPENDENT_ID" />
		<index column="ID" />
		<many-to-many
			column="FROM_ID"
			class="DataAccess.User, DataAccess"
			outer-join="true" />
    </list>
	<list name="Groups" table="GROUP2MODULE">
		<key column="MODULE_ID" />
		<index column="ID" />
		<many-to-many
			column="GROUP_ID"
			class="DataAccess.EducationGroup, DataAccess"
			outer-join="true" />
    </list>
	<list name="Docs" table="DOC2MODULE">
		<key column="MODULE_ID" />
		<index column="ID" />
		<many-to-many
			column="DOC_ID"
			class="DataAccess.EducationModule, DataAccess"
			outer-join="true" />
    </list>
  </class>
</hibernate-mapping>

